import { request } from 'umi';

export async function addBanner(params) {
  return request('/api/banner', {
    method: 'POST',
    data: { ...params },
  });
}

export async function removeBanner(params) {
  return request('/api/banner', {
    method: 'DELETE',
    data: { ...params },
  });
}

export async function updateBanner(params) {
  return request('/api/banner', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function queryBanner(params) {
  var data = await request('/api/banner', {
    params,
  });
  return data.data;
}

export async function addProductCategory(params) {
  return request('/api/productCategory', {
    method: 'POST',
    data: { ...params },
  });
}

export async function removeProductCategory(params) {
  return request('/api/productCategory', {
    method: 'DELETE',
    data: { ...params },
  });
}

export async function updateProductCategory(params) {
  return request('/api/productCategory', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function queryProductCategory(params) {
  var data = await request('/api/productCategory', {
    params,
  });
  return data.data;
}

export async function addProductType(params) {
  return request('/api/productType', {
    method: 'POST',
    data: { ...params },
  });
}

export async function removeProductType(params) {
  return request('/api/productType', {
    method: 'DELETE',
    data: { ...params },
  });
}

export async function updateProductType(params) {
  return request('/api/productType', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function queryProductType(params) {
  var data = await request('/api/productType', {
    params,
  });
  return data.data;
}

export async function queryProductCategoryVOList(params) {
  var data = await request('/api/productCategoryVOList', {
    params,
  });
  return data?.data;
}

export async function queryProductTypeList(params) {
  var data = await request('/api/productTypeList', {
    params,
  });
  return data?.data;
}

export async function addProduct(params) {
  return request('/api/product', {
    method: 'POST',
    data: { ...params },
  });
}

export async function removeProduct(params) {
  return request('/api/product', {
    method: 'DELETE',
    data: { ...params },
  });
}

export async function updateProduct(params) {
  return request('/api/product', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function queryProduct(params) {
  var data = await request('/api/product', {
    params,
  });
  return data.data;
}

export async function removeSysFile(params) {
  return request('/api/delPicture', {
    method: 'POST',
    data: {
      params: params,
    },
  });
}

export async function Updatepassword(params) {
  var data = await request('/api/login/password', {
    method: 'POST',
    data: { ...params },
  });
  return data?.data;
}

export async function addSaleChannel(params) {
  return request('/api/saleChannel', {
    method: 'POST',
    data: { ...params },
  });
}

export async function removeSaleChannel(params) {
  return request('/api/saleChannel', {
    method: 'DELETE',
    data: { ...params },
  });
}

export async function updateSaleChannel(params) {
  return request('/api/saleChannel', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function querySaleChannel(params) {
  var data = await request('/api/saleChannel', {
    params,
  });
  return data.data;
}

export async function querySaleChannelList(params) {
  var data = await request('/api/saleChannelList', {
    params,
  });
  return data?.data;
}

export async function queryOrderListSys(params) {
  var data = await request('/api/system/queryOrder', {
    params,
  });
  return data?.data;
}

//queryOrderInfo
export async function queryOrderInfo(params) {
  var data = await request('/api/system/queryOrderInfo', {
    params,
  });
  return data?.data;
}

export async function queryFeedbackList(params) {
  var data = await request('/api/feedback', {
    params,
  });
  return data?.data;
}
